********************************************************************************
* Crisis and the Trajectory of Science: Evidence from the 2014 Ebola Outbreak									   
*																			   *
* Caroline Fry							   *
*																			   *
* This script replicates the tables in the supplementary material for the article published in:     *
* Review of Economics and Statistics									   *
********************************************************************************

********************************************************************************
*                                Preliminaries                                 *
********************************************************************************

clear all

set matsize 11000

* Set path:
* global dir "PATH"
* cd "$dir"

capture log close





********************************************************************************
*                                    Table B1                          *
********************************************************************************


clear 
use ebola.dataset.dta  


* Specification 1
ppmlhdfe numpubs endemiccountrypost, absorb(careeragebin year idnumber) vce(cluster idnumber)

* Specification 2
ppmlhdfe numpubs endemiccountrypost endemiccountrypostntd, absorb(careeragebin year idnumber) vce(cluster idnumber)

* Specification 3
ppmlhdfe numpubs endemiccountrypost, absorb(careeragebin year) vce(cluster idnumber)

* Specification 4
ppmlhdfe numpubs endemiccountrypost endemiccountrypostntd,  absorb(careeragebin year) vce(cluster idnumber)

* Specification 5
ppmlhdfe numpubs endemiccountrypost numpubspre numpubsoecdcoauthorspre numpubsjifweightedpre numpubspipre numnewoecdcoauthorspre,  absorb(careeragebin year) vce(cluster idnumber)

* Specification 6
ppmlhdfe numpubs endemiccountrypost endemiccountrypostntd numpubspre numpubsoecdcoauthorspre numpubsjifweightedpre numpubspipre numnewoecdcoauthorspre,  absorb(careeragebin year) vce(cluster idnumber)

* Specification 7
ppmlhdfe numpubs endemiccountrypost numpubspre numpubsoecdcoauthorspre numpubsjifweightedpre numpubspipre numnewoecdcoauthorspre,  absorb(careeragebin year) vce(cluster countrycode)

* Specification 8
ppmlhdfe numpubs endemiccountrypost endemiccountrypostntd numpubspre numpubsoecdcoauthorspre numpubsjifweightedpre numpubspipre numnewoecdcoauthorspre, absorb(careeragebin year) vce(cluster countrycode)

* Specification 9
poisson numpubs endemiccountrypost endemiccountrypostntd   numpubspre numpubsoecdcoauthorspre numpubsjifweightedpre numpubspipre numnewoecdcoauthorspre i.year i.careeragebin, vce(bootstrap, seed(1) reps(25) cluster(countrycode))





********************************************************************************
*                                    Table B2                     *
********************************************************************************


clear 
use ebola.dataset.dta  

* Specification 1
ppmlhdfe nonebolapubs endemiccountrypost, absorb(careeragebin year idnumber) vce(cluster idnumber)

* Specification 2
ppmlhdfe nonebolapubs endemiccountrypost endemiccountrypostntd, absorb(careeragebin year idnumber) vce(cluster idnumber)

* Specification 3
ppmlhdfe nonebolapubs endemiccountrypost, absorb(careeragebin year) vce(cluster idnumber)

* Specification 4
ppmlhdfe nonebolapubs endemiccountrypost endemiccountrypostntd,  absorb(careeragebin year) vce(cluster idnumber)

* Specification 5
ppmlhdfe nonebolapubs endemiccountrypost numpubspre numpubsoecdcoauthorspre numpubsjifweightedpre numpubspipre numnewoecdcoauthorspre,  absorb(careeragebin year) vce(cluster idnumber)

* Specification 6
ppmlhdfe nonebolapubs endemiccountrypost endemiccountrypostntd numpubspre numpubsoecdcoauthorspre numpubsjifweightedpre numpubspipre numnewoecdcoauthorspre,  absorb(careeragebin year) vce(cluster idnumber)

* Specification 7
ppmlhdfe nonebolapubs endemiccountrypost numpubspre numpubsoecdcoauthorspre numpubsjifweightedpre numpubspipre numnewoecdcoauthorspre, absorb(careeragebin year) vce(cluster countrycode)

* Specification 8
ppmlhdfe nonebolapubs endemiccountrypost endemiccountrypostntd numpubspre numpubsoecdcoauthorspre numpubsjifweightedpre numpubspipre numnewoecdcoauthorspre, absorb(careeragebin year) vce(cluster countrycode)

* Specification 9
poisson nonebolapubs endemiccountrypost endemiccountrypostntd numpubspre numpubsoecdcoauthorspre numpubsjifweightedpre numpubspipre numnewoecdcoauthorspre i.year i.careeragebin, vce(bootstrap, seed(1) reps(25) cluster(countrycode))






********************************************************************************
*                                    Table B3                          *
********************************************************************************


clear 
use ebola.dataset.dta 

 
* Specification 1
ppmlhdfe numpubs endemiccountrypost endemiccountrypostntd , absorb(careeragebin year idnumber) vce(cluster idnumber)


* Specification 2
gen postplacebo = 0 
replace postplacebo = 1 if year > 2012
gen endemiccountrypostplacebo = 0 
replace endemiccountrypostplacebo = 1 if postplacebo == 1 & endemiccountry == 1 
gen endemiccountrypostntdplacebo = endemiccountrypostplacebo*dummyntdpubpre 

preserve 
keep if year < 2014 
ppmlhdfe numpubs endemiccountrypostplacebo endemiccountrypostntdplacebo,  absorb(careeragebin year idnumber) vce(cluster idnumber)
restore

* Specification 3
preserve
keep if numpubspre < 5
ppmlhdfe numpubs endemiccountrypost endemiccountrypostntd , absorb(careeragebin year idnumber) vce(cluster idnumber)
restore 

* Specification 4
preserve
keep if numpubsoecdcoauthorspre < 4
ppmlhdfe numpubs endemiccountrypost endemiccountrypostntd, absorb(careeragebin year idnumber) vce(cluster idnumber)
restore 






********************************************************************************
*                                    Table B4                          *
********************************************************************************


clear 
use ebola.dataset.dta  

* Specification 1
reghdfe ihs_numpubs endemiccountrypost i.year i.careeragebin, absorb(idnumber) vce(cluster idnumber)

* Specification 2
reghdfe ihs_numpubs endemiccountrypost endemiccountrypostntd  i.year i.careeragebin, absorb(idnumber) vce(cluster idnumber)

* Specification 3
reghdfe ihs_nonebolapubs  endemiccountrypost i.year i.careeragebin, absorb(idnumber) vce(cluster idnumber)

* Specification 4
reghdfe ihs_nonebolapubs endemiccountrypost endemiccountrypostntd  i.year i.careeragebin, absorb(idnumber) vce(cluster idnumber)

* Specification 5
reghdfe lognumpubs endemiccountrypost i.year i.careeragebin, absorb(idnumber) vce(cluster idnumber)

* Specification 6
reghdfe lognumpubs  endemiccountrypost endemiccountrypostntd i.year i.careeragebin, absorb(idnumber) vce(cluster idnumber)

* Specification 7
reghdfe lognonebolapubs  endemiccountrypost i.year i.careeragebin , absorb(idnumber) vce(cluster idnumber)

* Specification 8
reghdfe lognonebolapubs  endemiccountrypost endemiccountrypostntd i.year i.careeragebin, absorb(idnumber) vce(cluster idnumber)








********************************************************************************
*                                    Table C1                          *
********************************************************************************


clear 
use ebola.dataset.dta  

* Specification 1
ppmlhdfe numpubsjifweighted endemiccountrypost, absorb(careeragebin year idnumber) vce(cluster idnumber)

* Specification 2
ppmlhdfe numpubsjifweighted endemiccountrypost endemiccountrypostntd, absorb(careeragebin year idnumber) vce(cluster idnumber)

* Specification 3
ppmlhdfe nonebolapubsjifweighted endemiccountrypost, absorb(careeragebin year idnumber) vce(cluster idnumber)

* Specification 4
ppmlhdfe nonebolapubsjifweighted endemiccountrypost endemiccountrypostntd, absorb(careeragebin year idnumber) vce(cluster idnumber)







********************************************************************************
*                                    Table D1                          *
********************************************************************************


clear 
use ebola.dataset.dta  

* Specification 1
ppmlhdfe numpubs ebolacasesthouweighted, absorb(careeragebin year idnumber) vce(cluster idnumber)

* Specification 2
ppmlhdfe nonebolapubs ebolacasesthouweighted, absorb(careeragebin year idnumber) vce(cluster idnumber)

* Specification 3
ppmlhdfe numpubsoecdcoauthors ebolacasesthouweighted , absorb(careeragebin year idnumber) vce(cluster idnumber)

* Specification 4
ppmlhdfe numnewoecdcoauthors ebolacasesthouweighted , absorb(careeragebin year idnumber) vce(cluster idnumber)

